package ils.domain.issue.model;

import ils.util.HibernateSession;
import ils.util.HibernateSessionManager;
import ils.util.SpringUtil;
import junit.framework.Assert;
import org.junit.Test;
import org.springframework.context.ApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * User: rejeevd
 * Date: 23/09/12
 * Time: 11:39
 * To change this template use File | Settings | File Templates.
 */
public class ShelfRepositoryTest
{
    HibernateSessionManager hibernateSessionManager = new HibernateSessionManager();
    ApplicationContext context = SpringUtil.getApplicationContext();

    @Test
    public void testGetShelf()
    {
        try(HibernateSession session = hibernateSessionManager.getSession())
        {
            ShelfRepository repository = (ShelfRepository)context.getBean("shelfRepository");
            Shelf shelf = repository.getShelf(1);
            Assert.assertNotNull(shelf);
        }
    }
}
